<!-- header -->
<%
	String redirect = (String) request.getAttribute("redirected_from_home");
	if( redirect == null || !redirect.equalsIgnoreCase("true") ) {		
		response.sendRedirect("/writeonproject/home");
	}
%>

<% 
	String userId = request.getParameter("userId");
	Object curUser = request.getAttribute("userid");
	
	if (userId == null) {
	    response.sendRedirect("/writeonproject/home");
	} else if (curUser != null && ((String) curUser).equals(userId)) {
	    response.sendRedirect("/writeonproject/home?page=my_storylists");
	}
	
	String title = userId + "'s Storylists";
%>

<jsp:include page="header.jsp">
	<jsp:param name="title" value="<%= title%>"/>
</jsp:include>

<script type="text/javascript" src="js/storylist.js"></script>
<script type="text/javascript">checkIfUserExists(<%=userId%>);</script>
<script type="text/javascript">window.onload=updateStorylistsViewInit;</script>

<!-- / header -->

<!-- content -->
	<div class="body7">
		<div class="main">
			<section id="content">
				<div class="wrapper">
					<article>
						<div class="pad1">
							<h2><%= title %></h2>
							<br><br>							
							
							<%= "<input type=\"hidden\" id=\"userid\" value=\"" + userId + "\">" %>
							<table class="storylist_names">
								<thead>
									<tr>
										<th class="sl_names1 left_col">Storylist Name</th>
										<th class="sl_names2">Stories</th>
									</tr>
								</thead>
								<tbody id="storylists_body"></tbody>
							</table>
							
							<div id="nostories"></div>
						</div>
					</article>
				</div>
			</section>
		</div>
	</div>
	<!-- / content -->

<!-- footer -->
<jsp:include page="footer.jsp"/>
<!-- / footer -->
